<template>
    <component is="a-modal" v-model:visible="visible" width="80%" :title="title" :mask-closable="false"
        :ok-loading="loading" @cancel="close" @before-ok="submit">
        <div style="height: 70vh;overflow-y: scroll;">
            <sa-table ref="crudRef" :options="options" :columns="columns" :searchForm="searchForm">
                <template #state="{ record }">
                    <div class="over_text">审核状态: {{record.auth_state==0?'审核状态回退( 重新审核 )' :record.auth_state_text }}
                    </div>
                    <div class="over_text">审核备注: {{ record?.msg||'' }}</div>
                    <div class="over_text">审核时间: {{ record.create_time }}</div>
                </template>
                <template #user="{ record }">
                    <div>UID: {{record.info?.user_id }}</div>
                    <div>会员名称: {{record.user_name }}</div>
                </template>
                <template #account="{ record }">
                    <div>账号类型: {{ record.reg_type_text }}</div>
                    <a-tooltip :content="record.info?.true_name">
                        <div>收款人中文名: {{ record.info?.true_name }}</div>
                    </a-tooltip>
                    <a-tooltip :content="record.info?.bank_name">
                        <div>银行名称: {{ record.info?.bank_name }}</div>
                    </a-tooltip>
                    <a-tooltip :content="record.info?.sub_bank_name">
                        <div>支行名称: {{ record.info?.sub_bank_name }}</div>
                    </a-tooltip>
                    <a-tooltip :content="record.info?.number">
                        <div>银行账号: {{ record.info?.number }}</div>
                    </a-tooltip>
                </template>
                <template #view="{ record }">
                    <div v-if="record.info?.image">
                        <div >
                            <a :href="record.info?.image" target="_blank" style="color:#5c7cfa;cursor: pointer;"> 签约文件</a>
                        </div>
                        
                    </div>
                    <div v-else>
                        未上传
                    </div>
                </template>

            </sa-table>


        </div>




    </component>
</template>
<script setup>
import { onMounted, ref, reactive, computed, watch } from 'vue'
import memberApi from '@/api/system/member'
import SaTable from '@cps/sa-table/index.vue'
import { Message } from '@arco-design/web-vue'
import { throttle } from 'lodash';
import tool from '@/utils/tool'
const emit = defineEmits(["success"]);
const visible = ref(false);
const title = ref('审核记录')
const crudRef = ref()
const loading = ref(false);
const searchForm = reactive({
    table_id: ''
})
const options = reactive({
    api: memberApi.member_bank_List_log,//表格数据接口
    operationColumnWidth: 180,//操作欄
    columnAlign: 'left',
    pageSimple: false,
    isExpand: false,//展開所有子樹
    showSearch: false,
    operationColumn: false

})

const columns = reactive([
    { title: '审核管理员', dataIndex: 'admin_name', width: 120 },
    { title: '审核状态', dataIndex: 'state', width:240 },
    { title: '会员', dataIndex: 'user', width: 220 },
    { title: '账户', dataIndex: 'account', width: 220 },
    { title: '资料查看', dataIndex: 'view', width: 220,align:'center' },

])
const open = async (data) => {
    searchForm.table_id = data.id
    console.log('111', data);
    visible.value = true;
    refresh()
}
const refresh = async () => {
    crudRef.value?.refresh()
}
const paramsData = ref({})
const getParams = async () => {

}
defineExpose({ open });
</script>